package com.coin900.coin.server;


import com.coin900.coin.base.Constants;
import com.coin900.coin.base.FuConstants;
import com.coin900.coin.base.mail.AMail;
import com.coin900.coin.base.mail.ActivationMail;
import com.coin900.coin.base.mail.MailSender;
import com.coin900.coin.service.sbi.ISbiSystemConfigService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;


/**
 * Unibon
 * <p/>
 * Copyright (c) 2012 YouPeng ValueSoft Inc., All rights reserved.
 * <p/>
 * This software is the confidential and proprietary information of
 * ValueSoft Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with ValueSoft.com.
 * <p/>
 * Revision History
 * Date      		Programmer       Notes
 * 2014/5/8   	     libo		     Initial
 * *********************************************************************
 */
@Controller
public class EnvCtrl extends BaseController implements InitializingBean {
    private static final Log logger = LogFactory.getLog(EnvCtrl.class);


    @Override
    public void afterPropertiesSet() throws Exception {
        FuConstants.ACCESS_KEY = "7JzlGgmsG0Idal2ywhU0huFtDH-8dINGLdJROfEA";
        FuConstants.SECRET_KEY = "xj_Cv1IzUaTWzSCqWYNkCCe1_N9T6_kUt0lJQc-E";
        FuConstants.BUCKET_NAME = "xchat-dev";
        FuConstants.BUCKET_DOMAIN = "http://op007tqer.bkt.clouddn.com";

        FuConstants.P_ACCESS_KEY = "7JzlGgmsG0Idal2ywhU0huFtDH-8dINGLdJROfEA";
        FuConstants.P_SECRET_KEY = "xj_Cv1IzUaTWzSCqWYNkCCe1_N9T6_kUt0lJQc-E";
        FuConstants.P_BUCKET_NAME = "xchat-p";
        FuConstants.P_BUCKET_DOMAIN = "http://otq48t1yh.bkt.clouddn.com";

        FuConstants.SMS_DY_ACCESS_KEY_ID = this.configService.getSystemConfig("FU_WEB", "SMS", "SMS_DY_ACCESS_KEY_ID", Constants.env).getValue();
        FuConstants.SMS_DY_ACCESS_KEY_SECRET = this.configService.getSystemConfig("FU_WEB", "SMS", "SMS_DY_ACCESS_KEY_SECRET", Constants.env).getValue();
        FuConstants.SMS_DY_SIGN_NAME = this.configService.getSystemConfig("FU_WEB", "SMS", "SMS_DY_SIGN_NAME", Constants.env).getValue();
        FuConstants.SMS_DY_TEMPLATE_CODE = this.configService.getSystemConfig("FU_WEB", "SMS", "SMS_DY_TEMPLATE_CODE", Constants.env).getValue();
    }


    @Autowired
    private ISbiSystemConfigService configService;

}
